#!/bin/bash # It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Desktop Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description - Script to untrust certificate in Mac # Script Arguments - "" (Should be the exact name as in dependency file) # Dependency Files - "" # Configuration - COMPUTER CERTNAME=$1 echo "$CERTNAME" sudo security add-trusted-cert -d -r deny -k "/Library/Keychains/System.keychain" "$CERTNAME" errcode=$? if [ "$errcode" -ne 0 ]; then echo "" echo "Failed to remove certificate trust with errorcode $errcode" 1>&2 echo "" exit 1 fi echo "Successfully removed certificate trust" 1>&2